**Kane Mason Wronski**
/* "WHO'S AT THE PARTY?"  JOURNAL OF POLITICS REPLICATIONS
Qualtrics Survey DATA CODING */

***************************************
*Generate Perceptual Accuracy Measures
***************************************
	*Democratic Groups
gen PlaceDemGroupsCorrect2= g3placecorrect+g5placecorrect+g6placecorrect+g7placecorrect+g10placecorrect+g11placecorrect+g12placecorrect+g13placecorrect+g16placecorrect+g17placecorrect+g18placecorrect+g19placecorrect+g20placecorrect
gen PlaceDemGroupsCorrect2_01=PlaceDemGroupsCorrect2/13

	*Republican Groups
gen PlaceRepGroupsCorrect2= g4placecorrect+g8placecorrect+g9placecorrect+g14placecorrect+g15placecorrect+g22placecorrect
gen PlaceRepGroupsCorrect2_01=PlaceRepGroupsCorrect2/6

tab1 PlaceDemGroupsCorrect2 PlaceRepGroupsCorrect2

	*Correlations with political knowledge scale and political interest
		*note:  only approximately half of respondents were assigned the knowledge questions used in the scale
pwcorr PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 knowledgescale01 polint01, sig


*Incorrect Placement
tab1 PlaceDemGroupsINCorrect2 PlaceRepGroupsINCorrect2

***************************************
*Obtaining x-axis values for Figure 1
***************************************

// Group placements

gen poorwelf_place1=groupplac1_3
gen antiimmigrant_place1=groupplac1_4
gen unionworkers_place1=groupplac1_5
gen gays_place1=groupplac1_6
gen environmentalists_place1=groupplac1_7
gen businesspeople_place1=groupplac1_8
gen gunowners_place1=groupplac1_9
gen blacks_place1=groupplac1_10
gen feminists_place1=groupplac1_11
gen muslims_place1=groupplac1_12
gen antigunpeople_place1=groupplac1_13
gen evangelicals_place1=groupplac1_14
gen promilitarypeople_place1=groupplac1_15
gen hispanics_place1=groupplac1_16
gen asians_place1=groupplac1_17
gen antiwar_place1=groupplac1_18
gen jews_place1=groupplac1_19
gen secularatheists_place1=groupplac1_20
gen catholics_place1=groupplac1_21
gen mormons_place1=groupplac1_22

gen poorwelf_place2=-groupplac2_3+4
gen antiimmigrant_place2=-groupplac2_4+4
gen unionworkers_place2=-groupplac2_5+4
gen gays_place2=-groupplac2_6+4
gen environmentalists_place2=-groupplac2_7+4
gen businesspeople_place2=-groupplac2_8+4
gen gunowners_place2=-groupplac2_9+4
gen blacks_place2=-groupplac2_10+4
gen feminists_place2=-groupplac2_11+4
gen muslims_place2=-groupplac2_12+4
gen antigunpeople_place2=-groupplac2_13+4
gen evangelicals_place2=-groupplac2_14+4
gen promilitarypeople_place2=-groupplac2_15+4
gen hispanics_place2=-groupplac2_16+4
gen asians_place2=-groupplac2_17+4
gen antiwar_place2=-groupplac2_18+4
gen jews_place2=-groupplac2_19+4
gen secularatheists_place2=-groupplac2_20+4
gen catholics_place2=-groupplac2_21+4
gen mormons_place2=-groupplac2_22+4


// Combining both answers to get single measure of group placement and obtaining means
	
*Poor
gen poorwelf_place=poorwelf_place1 if poorwelf_place2==.
replace poorwelf_place=poorwelf_place2 if poorwelf_place1==.
mean poorwelf_place
	
*Nativists
gen antiimmigrant_place=antiimmigrant_place1 if antiimmigrant_place2==.
replace antiimmigrant_place=antiimmigrant_place2 if antiimmigrant_place1==.
mean antiimmigrant_place
	
*Union workers
gen unionworkers_place=unionworkers_place1 if unionworkers_place2==.
replace unionworkers_place=unionworkers_place2 if unionworkers_place1==.
mean unionworkers_place

*LGBT
gen gays_place=gays_place1 if gays_place2==.
replace gays_place=gays_place2 if gays_place1==.
mean gays_place

*Environmentalists
gen environmentalists_place=environmentalists_place1 if environmentalists_place2==.
replace environmentalists_place=environmentalists_place2 if environmentalists_place1==.
mean environmentalists_place

*Businesspeople
gen businesspeople_place=businesspeople_place1 if businesspeople_place2==.
replace businesspeople_place=businesspeople_place2 if businesspeople_place1==.
mean businesspeople_place

* Gun owners
gen gunowners_place=gunowners_place1 if gunowners_place2==.
replace gunowners_place=gunowners_place2 if gunowners_place1==.
mean gunowners_place

* African-Americans
gen blacks_place=blacks_place1 if blacks_place2==.
replace blacks_place=blacks_place2 if blacks_place1==.
mean blacks_place

*Feminists
gen feminists_place=feminists_place1 if feminists_place2==.
replace feminists_place=feminists_place2 if feminists_place1==.
mean feminists_place

*Muslims
gen muslims_place=muslims_place1 if muslims_place2==.
replace muslims_place=muslims_place2 if muslims_place1==.
mean muslims_place

*Anti-gun people
gen antigunpeople_place=antigunpeople_place1 if antigunpeople_place2==.
replace antigunpeople_place=antigunpeople_place2 if antigunpeople_place1==.
mean antigunpeople_place

*Evangelicals
gen evangelicals_place=evangelicals_place1 if evangelicals_place2==.
replace evangelicals_place=evangelicals_place2 if evangelicals_place1==.
mean evangelicals_place

*Pro-military people
gen promilitarypeople_place=promilitarypeople_place1 if promilitarypeople_place2==.
replace promilitarypeople_place=promilitarypeople_place2 if promilitarypeople_place1==.
mean promilitarypeople_place

*Hispanics
gen hispanics_place=hispanics_place1 if hispanics_place2==.
replace hispanics_place=hispanics_place2 if hispanics_place1==.
mean hispanics_place

*Asians
gen asians_place=asians_place1 if asians_place2==.
replace asians_place=asians_place2 if asians_place1==.
mean asians_place

*Antiwar
gen antiwar_place=antiwar_place1 if antiwar_place2==.
replace antiwar_place=antiwar_place2 if antiwar_place1==.
mean antiwar_place
	
*Jewish people
gen jews_place=jews_place1 if jews_place2==.
replace jews_place=jews_place2 if jews_place1==.
mean jews_place
	
*Seculars
gen secularatheists_place=secularatheists_place1 if secularatheists_place2==.
replace secularatheists_place=secularatheists_place2 if secularatheists_place1==.
mean secularatheists_place

*Catholics  // maybe don't include
gen catholics_place=catholics_place1 if catholics_place2==.
replace catholics_place=catholics_place2 if catholics_place1==.
mean catholics_place

*Mormons
gen mormons_place=mormons_place1 if mormons_place2==.
replace mormons_place=mormons_place2 if mormons_place1==.
mean mormons_place



******************************************************************************
*Obtaining Beta Coefficients for x-axis of Figure D5
******************************************************************************

	*anti-immigrant:  .04 (p<.001)
reg pid01 antiimmigrant_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* jewish: -.001 (p=.93)
reg pid01 jews_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*mormons: .02 (p.=02) 
reg pid01 mormons_evals ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*union workers:  -.06 (p<.001)
reg pid01 unionworkers_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*lgbt:  -.06 (p<.001)
reg pid01 gays_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*catholics: .03 (p<.01)
reg pid01 catholics_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* gun owners: .06 (p<.001)
reg pid01 gunowners_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* evangelicals: .05 (p<.001)
reg pid01 evangelicals_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*asians:  -.01 (p=.16)
reg pid01 asians_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*blacks: -.03 (p<.001)
reg pid01 blacks_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*hispanics:  -.02 (p<.01)
reg pid01 hispanics_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*anti-gun:  -.07 (p<.001)
reg pid01 antigunpeople_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* anti-war people:  -.07 (p<.001)
reg pid01 antiwar_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* muslims:  -.07 (p<.001)
reg pid01 muslims_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* environmentalists:  -.06 (p<.001)
reg pid01 environmentalists_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* the poor:  -.06 (p<.001)
reg pid01 poorwelf_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* feminists:  -.07 (p<.001)00
reg pid01 feminists_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* seculars: -.05 (p<.001)
reg pid01 secularatheists_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	*pro-military: .06 (p<.001)
reg pid01 promilitarypeople_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust
	* business people: .03 (p<.001)
reg pid01 businesspeople_eval ///
PlaceDemGroupsCorrect2_01 PlaceRepGroupsCorrect2_01 polint01 c.age01##c.age01  edu01 inc01 ///
female  black hispanic other_race protestant catholic mormon jewish other_rel religiosity01, robust

